Skip to content

docs: fill missing CHANGELOG entries; fix map-release Gate 12 awk bug#324

Merged
azalio merged 1 commit into
mainfrom
docs-changelog-and-map-release-gate-fix
Jul 2, 2026
Merged

docs: fill missing CHANGELOG entries; fix map-release Gate 12 awk bug#324
azalio merged 1 commit into
mainfrom
docs-changelog-and-map-release-gate-fix

Conversation

@azalio

@azalio azalio commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

Test plan

  • make check passes (3236 passed, render-parity clean)
  • Manually re-verified the CHANGELOG entry count against git log since v3.20.0 after the fix

Summary by CodeRabbit

  • New Features

    • Added a new adversarial review option.
    • Expanded token report capabilities with dashboard, history, estimates, and export.
    • Learned rules can now be filtered by path pattern.
    • Release notes can now be published automatically.
  • Bug Fixes

    • Reduced false positives on MAP-only artifacts.
    • Improved handling of workflow context, timeouts, and spec citations.

…release CHANGELOG gate awk bug

CHANGELOG.md was missing entries for #317, #307, #301/#300, #292/#289,
#280, #279, and the Claude-side adversarial review feature (2991e7e) —
all landed after v3.20.0 but never documented.

Also fix the /map-release skill's Gate 12 completeness check: the
awk range pattern /## \[Unreleased\]/,/## \[/ collapses to a single
line when start and end match the same line, which they do for the
"## [Unreleased]" heading itself (it matches both patterns). This
made the gate always report 0 CHANGELOG entries. Switched to an
explicit flag-based awk in all three occurrences (count, review
display, semver-analysis extraction) and dropped the now-unneeded
trailing `sed '$d'`.
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Fixed a bug in awk extraction logic used across three copies of the map-release SKILL.md files where a range-pattern awk command could collapse when start/end patterns overlapped, replacing it with flag-based state toggling. CHANGELOG.md's Unreleased section was also updated with new entries.

Changes

Awk extraction fix across SKILL.md variants

Layer / File(s) Summary
Source SKILL.md awk fix
.claude/skills/map-release/SKILL.md
Replaces range-pattern awk with flag-based awk for CHANGELOG_ENTRIES counting, Unreleased content display, and UNRELEASED_CHANGES extraction; removes sed '$d' trimming.
Jinja template awk fix
src/mapify_cli/templates_src/skills/map-release/SKILL.md.jinja
Applies the same stateful awk logic to the jinja template used to generate the SKILL.md file.
Generated template awk fix
src/mapify_cli/templates/skills/map-release/SKILL.md
Applies the identical flag-based awk fix and explanatory comment to the generated template counterpart.
CHANGELOG entries update
CHANGELOG.md
Adds Added bullets (adversarial review, tokenreport, path_glob rule scoping, GitHub Release automation) and Fixed bullets (workflow-context suppression, fail-safe test baseline timeout, bare-spec citation auto-resolution) to the Unreleased section.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

Not applicable — changes are limited to shell script logic edits and documentation entries, without multi-component control flow.

Poem

A range that collapsed, oh what a fright,
Now a flag-based awk sets the parsing right! 🥕
Three files in sync, hopping in a row,
The CHANGELOG grows with entries aglow.
This bunny thumps twice — bug fixed, let's go! 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the two main changes: filling missing CHANGELOG entries and fixing the map-release Gate 12 awk bug.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs-changelog-and-map-release-gate-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/mapify_cli/templates_src/skills/map-release/SKILL.md.jinja`:
- Around line 201-206: The CHANGELOG_ENTRIES calculation in the map-release
SKILL template is adding a redundant fallback that can turn an empty count into
duplicate output. Remove the `|| echo "0"` behavior from the Unreleased-section
counting logic, and either count matching entries directly in `awk` or keep
using `grep -cE` while only suppressing its nonzero exit status so
`CHANGELOG_ENTRIES` stays a single numeric value.

In `@src/mapify_cli/templates/skills/map-release/SKILL.md`:
- Around line 201-206: The CHANGELOG entry count logic in the SKILL.md template
currently appends a fallback that can emit a duplicate zero and break the
numeric check. Update the Unreleased counting flow around CHANGELOG_ENTRIES so
it relies on grep -c alone or uses awk to compute the count without printing an
extra value; keep the existing Unreleased section extraction logic and remove
the fallback that writes another 0.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: be87ecc4-dd0e-4341-8264-2dcc260f36f4

📥 Commits

Reviewing files that changed from the base of the PR and between d724112 and 6ecb126.

📒 Files selected for processing (4)
  • .claude/skills/map-release/SKILL.md
  • CHANGELOG.md
  • src/mapify_cli/templates/skills/map-release/SKILL.md
  • src/mapify_cli/templates_src/skills/map-release/SKILL.md.jinja

Comment on lines +201 to +206
# Count CHANGELOG entries in [Unreleased] section.
# NOTE: a range-pattern awk (/start/,/end/) collapses to the single
# matching line when start and end match the SAME line — and "##
# [Unreleased]" matches both "/## \[Unreleased\]/" and "/## \[/". Use an
# explicit flag instead so the range spans past the heading line itself.
CHANGELOG_ENTRIES=$(awk '/^## \[Unreleased\]/{f=1;next} /^## \[/{f=0} f' CHANGELOG.md | grep -cE "^- " || echo "0")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

file='src/mapify_cli/templates_src/skills/map-release/SKILL.md.jinja'

# Show the relevant section with line numbers
sed -n '190,215p' "$file" | cat -n

# Inspect how CHANGELOG_ENTRIES is later used
rg -n "CHANGELOG_ENTRIES|CHANGELOG.md|grep -cE \"^- \"" "$file"

Repository: azalio/map-framework

Length of output: 2029


Drop the || echo "0" fallback. grep -c already prints 0; the fallback appends a second 0, so CHANGELOG_ENTRIES can become 0\n0 and break the numeric check. Count directly in awk, or keep grep's output and suppress only its exit status.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/mapify_cli/templates_src/skills/map-release/SKILL.md.jinja` around lines
201 - 206, The CHANGELOG_ENTRIES calculation in the map-release SKILL template
is adding a redundant fallback that can turn an empty count into duplicate
output. Remove the `|| echo "0"` behavior from the Unreleased-section counting
logic, and either count matching entries directly in `awk` or keep using `grep
-cE` while only suppressing its nonzero exit status so `CHANGELOG_ENTRIES` stays
a single numeric value.

Comment on lines +201 to +206
# Count CHANGELOG entries in [Unreleased] section.
# NOTE: a range-pattern awk (/start/,/end/) collapses to the single
# matching line when start and end match the SAME line — and "##
# [Unreleased]" matches both "/## \[Unreleased\]/" and "/## \[/". Use an
# explicit flag instead so the range spans past the heading line itself.
CHANGELOG_ENTRIES=$(awk '/^## \[Unreleased\]/{f=1;next} /^## \[/{f=0} f' CHANGELOG.md | grep -cE "^- " || echo "0")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

sed -n '190,230p' src/mapify_cli/templates/skills/map-release/SKILL.md

Repository: azalio/map-framework

Length of output: 2029


Drop the || echo "0" fallback. grep -c already prints 0 when there are no matches, so the fallback turns that into 0\n0 and can break the later numeric comparison. Count in awk or suppress the exit status without printing another value.

🧰 Tools
🪛 SkillSpector (2.3.7)

[warning] 19: [EA2] Autonomous Decision Making: Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Remediation: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.

(Excessive Agency (EA2))


[error] 1114: [TM1] Tool Parameter Abuse: Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Remediation: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.

(Tool Misuse (TM1))

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/mapify_cli/templates/skills/map-release/SKILL.md` around lines 201 - 206,
The CHANGELOG entry count logic in the SKILL.md template currently appends a
fallback that can emit a duplicate zero and break the numeric check. Update the
Unreleased counting flow around CHANGELOG_ENTRIES so it relies on grep -c alone
or uses awk to compute the count without printing an extra value; keep the
existing Unreleased section extraction logic and remove the fallback that writes
another 0.

@azalio azalio merged commit c080222 into main Jul 2, 2026
7 checks passed
@azalio azalio deleted the docs-changelog-and-map-release-gate-fix branch July 2, 2026 14:12
azalio added a commit that referenced this pull request Jul 3, 2026
Two framework bugs surfaced and were fixed during /map-release Phase 1
(PR #323, #324): a flaky test from a substring-in-joined-argv check,
and an awk two-address range that collapsed to one line because its
start/end patterns could co-match. Both are instances of the same
root cause -- testing discrete-unit membership on a flattened/implicit
proxy instead of the structured representation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant